Skip to content

Add naga-wgsl target v2#493

Open
Firestar99 wants to merge 3 commits intotarget-declfrom
naga-wgsl-v2
Open

Add naga-wgsl target v2#493
Firestar99 wants to merge 3 commits intotarget-declfrom
naga-wgsl-v2

Conversation

@Firestar99
Copy link
Copy Markdown
Member

@Firestar99 Firestar99 commented Dec 17, 2025

Requires #491

Supersedes #280

Adds spirv-unknown-naga-wgsl target for built-in naga transpilation to wgsl. Further naga targets could be added easily.

Quite a lot compiletest fail with naga, common reasons include:

  • unsupported extensions & capabilities (mesh shader, ray tracing etc.)
  • no support for u8 & i8
  • unknown instructions
  • Vertex shaders must return a @builtin(position) output value

For now, I'd just accept that any naga targets won't pass our compiletest suite and not add a CI step for that.

@Firestar99 Firestar99 marked this pull request as draft December 17, 2025 16:44
@Firestar99 Firestar99 changed the title Naga wgsl v2 Add naga-wgsl target v2 Dec 17, 2025
Comment on lines +23 to +26
use-installed-tools = ["spirv-tools/use-installed-tools", "naga"]
# If enabled will compile and link the C++ code for the spirv tools, the compiled
# version is preferred if both this and `use-installed-tools` are enabled
use-compiled-tools = ["spirv-tools/use-compiled-tools"]
use-compiled-tools = ["spirv-tools/use-compiled-tools", "naga"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, this effectively makes naga non-optional if I'm reading it correctly. Is it intentional?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's from the old PR, added with comment

wgsl: enable naga feature by default, cargo-gpu can't handle it

So this was more a hack than anything else. I'll have a look what the compile time impact is, and if it's actually significant (which next to spirv-tools-sys may not be), look into making it optional and supported by cargo-gpu.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if naga should really be a dependency of either of those two features. Why not let user specify it explicitly instead?

Copy link
Copy Markdown
Member Author

@Firestar99 Firestar99 Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cargo-gpu can't handle it

we'd need to build the infra in cargo-gpu first

@Firestar99 Firestar99 mentioned this pull request Dec 19, 2025
@Firestar99 Firestar99 force-pushed the naga-wgsl-v2 branch 2 times, most recently from 32d2899 to 6e2f673 Compare December 19, 2025 12:14
@Firestar99 Firestar99 force-pushed the target-decl branch 2 times, most recently from b933e50 to 4b595cd Compare April 15, 2026 10:48
@Firestar99
Copy link
Copy Markdown
Member Author

  • upgraded naga 27 -> 29
  • remove CI checking compiletests with naga target, too many failures due to transpilation to bother atm

@Firestar99 Firestar99 marked this pull request as ready for review April 15, 2026 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants